<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019-02-21
 * Time: 10:47
 */

namespace app\admin\controller;


use app\common\controller\AdminBase;
use app\common\model\Transferrecordm;

class Transferrecord extends AdminBase
{
    public function index($oneemail ='',$twoemail ='', $page = 1)
    {
        $map = [];
        if ($oneemail) {//转账人
            $oneemail = trim($oneemail);
            $map['one.u_email'] = ['like', "%{$oneemail}%"];
        }
        if ($twoemail) {//被转账人
            $twoemail = trim($twoemail);
            $map['two.u_email'] = ['like', "%{$twoemail}%"];
        }
        $list = Transferrecordm::index($map, $page);
        return $this->fetch('index', ['list' => $list, 'oneemail' => $oneemail, 'twoemail' => $twoemail]);
    }

    /**
     * 转账详情
     */
    public function detail($id)
    {
        $detail = Transferrecordm::detail($id);
        return $this->fetch('detail', ['detail' => $detail]);
    }



}